package com.gitee.wsl.config.pref

import com.gitee.wsl.data.store.StoreServer
import kotlin.reflect.KProperty

internal class StringPref(
    val default: String,
    override val key: String?,
    private val commitByDefault: Boolean
) : AbstractPref<String>() {
    override fun getFromPreference(property: KProperty<*>, preference: StoreServer): String {
        return preference.getPreferenceOrDefault(preferenceKey, default)
    }

    override fun setToPreference(property: KProperty<*>, value: String, preference: StoreServer) {
        preference.putPreference(preferenceKey,value)
    }
}